//---------------------------------------------------------------------------

#ifndef CLoggerH
#define CLoggerH
//---------------------------------------------------------------------------


#define TIMEOUT_LOGWAIT 5000

class CLogger
{
public:
  bool Init();
  static bool Create();
  static void Shutdown();

  void SetMsgWnd(TMemo *MemoWnd);

  void LogMsg(int iDebugLevel, char *szMsg, ...);
  void LogMsg(char *szMsg, ...);

  int GetDebugLevel() {return LogDebugLevel;}
  void SetDebugLevel(int DbgLevel) { LogDebugLevel = DbgLevel;}
//  char *GetNameModule(){return szNameModule;}
  void LogMsgF(char *szMsg, ...);
  void DelLogFile(bool f_LogDelete);

private:
  CLogger();
  ~CLogger();


  char *szNameModule;
  int LogDebugLevel;

  char *GetCurrDateTime();
  bool WriteLog(char *szFileName, char *szLogLine);

  TMemo *m_MLogMsg;
  char  szNameLogFile[MAX_PATH];

  HANDLE hMutex;
};

extern CLogger          *mlog;





























#endif
